package com.xyoto.takeawayUser.controller;

import com.xyoto.takeawayUser.dto.SelDetailDto;
import com.xyoto.takeawayUser.service.ShopService;
import com.xyoto.takeawayUser.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @ClassName: 店铺模块
 * @Author: 挽风
 * @Date: 2022
 * @Copyright: 2022 by 挽风
 * @Description:
 **/

@RestController
@RequestMapping("/shop")
@Api(tags = "店铺模块")
public class ShopController {
    
    @Autowired
    private ShopService shopService;

    @GetMapping("/getShopProdSnapshotList")
    @ApiOperation(value = "店铺详情商品快照列表", notes = "获取店铺详情商品快照信息列表")
    public Result getShopProdSnapshotList(@NotNull(message = "店铺id不能为空")
                                              @RequestParam("shopId") Integer shopId){
        return shopService.getShopProdSnapshotList(shopId);
    }

    @GetMapping("/getShopDetail")
    @ApiOperation(value = "获取店铺详情", notes = "根据shopId查询店铺详情信息")
    public Result getShopDetail(@NotNull(message = "店铺id不能为空")
                                    @RequestParam("shopId") Integer shopId){
        return shopService.getShopDetail(shopId);
    }
}
